package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-06
 * Time: 14:43
 */


@RestController
public class CalcController {

    @RequestMapping("/calc")
    public String calc(Integer num1,Integer num2){
        if (num1 == null && num2 == null){
            return "参数错误！";
        }
        return "<h1>" + (num1+num2) + "</h1>"; //如果不加括号 那么就是字符串拼接
    }
}
